﻿/*
This file is under Microsoft Public License (MS-PL)
Copyright Yohann MARTEL.  All rights reserved.
Codeplex: http://amf.codeplex.com
AMF Website: http://www.ymartel.com/aspnet-mobile-framework/
*/
using System;
using System.ComponentModel;
using System.Web.UI;

namespace Mobile.WebControls
{
    [DefaultProperty("BubbleInfo")]
    public class CountBubbleListViewItem : Span
    {
        #region Properties
        [Bindable(true),
        DefaultValue(""),
        PersistenceMode(PersistenceMode.InnerDefaultProperty),
        Localizable(true),
        Category("Appearance")]
        public string BubbleInfo { get; set; }
        #endregion

        #region Render Methods
        protected override void RenderContents(HtmlTextWriter writer)
        {
            base.RenderContents(writer);
            if (!String.IsNullOrEmpty(BubbleInfo))
            {
                writer.Write(BubbleInfo);
            }
        }

        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, JqueryCssClass.ListCountBubble);
        }
        #endregion
    }
}
